﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// BankCodeMaping 的摘要描述
/// </summary>
public class BankCodeMaping
{
	public BankCodeMaping()
	{
		//
		// TODO: 在此加入建構函式的程式碼
		//
	}
    private string _fiscBankType;
    public string fiscBankType
    {
        get
        {
            return _fiscBankType;
        }
        set
        {
            _fiscBankType = value;
        }
    }
    private string _fiscBankCode;
    public string fiscBankCode
    {
        get
        {
            return _fiscBankCode;
        }
        set
        {
            _fiscBankCode = value;
        }
    }
    private string _fiscBankName;
    public string fiscBankName
    {
        get
        {
            return _fiscBankName;
        }
        set
        {
            _fiscBankName = value;
        }
    }
    private string _memo;
    public string memo
    {
        get
        {
            return _memo;
        }
        set
        {
            _memo = value;
        }
    }
    private string _summitCustID;
    public string summitCustID
    {
        get
        {
            return _summitCustID;
        }
        set
        {
            _summitCustID = value;
        }
    }
    public void getBankCodeMapBySummitID()
    {
        using (TR_DBDataContext db = new TR_DBDataContext())
        {
            var itemList = from P in db.TR_BankingMap where P.SummitCustID.Trim().Equals(_summitCustID) select P;
            if (itemList.Count() > 0)
            {
                TR_BankingMap item = (from P in db.TR_BankingMap where P.SummitCustID.Trim().Equals(_summitCustID) select P).First();
                _fiscBankType = Convert.ToString(item.FISC_BankType).TrimEnd();
                _fiscBankCode = item.FISC_BankCode.TrimEnd();
                _fiscBankName = item.FISC_BankName.TrimEnd();
                _memo = item.Memo.TrimEnd();
                _summitCustID = item.SummitCustID.TrimEnd();
            }
        }
    }
}
